#pragma once
#ifndef PLANES_CONFIG_H
#define PLANES_CONFIG_H

#include "./pugixml/pugixml.hpp"
#include <vector>
#include <iostream>
#include <cstring> // for memset
#include "interface.h"

struct PlaneConfig {
    int planeID;
    struct {
        double longitude;
        double latitude;
        double altitude;
    } position;
    struct {
        double TAS;
    } velocity;
    struct {
        double yaw;
        double roll;
        double pitch;
    } angle;
    int team;
    int targetID;
    struct {
        int state;
    } radar;
    struct {
        double roll_ctrl;
        double pitch_ctrl;
        double yaw_ctrl;
        double throttle;
    } control;
};

class PlaneXMLConfigReader {
public:
    bool loadFromFile(std::vector<PlaneState_S> &planes,
        const std::string& filename);
private:
    void applyConfigToPlane(PlaneState_S& plane, const PlaneConfig& config);
};

#endif